import {createApp} from 'vue'

import '@/common/assets/style/abl-flex.less'
import '@/common/assets/style/abl-layout.less'
import 'element-plus/dist/index.css'

import App from '@/App.vue'
import ElementPlus from 'element-plus'
import router from '@/common/router'
import store from "@/common/store/store";

import '@/permission'
// svg图标
import * as IconComponents from '@element-plus/icons-vue'
import 'virtual:svg-icons-register'
import AIcon from "@/common/component/AIcon.vue";
import DictTag from "@/common/component/DictTag.vue";
//指令
import hasKey from "@/common/utils/hasKey";
import hasRole from "@/common/utils/hasRole";

const app = createApp(App);

app.use(router)
app.use(store);
app.use(ElementPlus)

// svg组件
for (const key in IconComponents) {
    const componentConfig = IconComponents[key];
    app.component(componentConfig.name, componentConfig);
}
//组件
app.component('a-icon', AIcon)
app.component('dict-tag', DictTag)

//指令
app.directive('hasRole', hasRole)
app.directive('hasKey', hasKey)

//忽略警告信息
app.config.warnHandler = (msg, instance, trace) => {
}

app.mount('#app');

